{template 'admin','header'}
<form action="{URL}" method="POST" onsubmit="return r_submit(this);">
<table class="table_form">
<caption>组角色设定</caption>
{loop $rolelist $roleid=>$role}
<tr>
	<th width="20%">{$role}</th>
	<td>
	<input type="radio" onclick="document.getElementById('perm_{$roleid}').style.display='none'" {if !isset($group_role_list[$roleid])} checked {/if} value="0" name="r_flag[{$roleid}]">默认角色权限&nbsp;
	<input type="radio" onclick="document.getElementById('perm_{$roleid}').style.display=''" {if isset($group_role_list[$roleid])} checked {/if} value="1" name="r_flag[{$roleid}]">自定义角色权限<br/>
	<div id="perm_{$roleid}" style="display:{if !isset($group_role_list[$roleid])}none;{else};{/if}">
	{loop $permlist $pres}
	<strong>{$pres['type']['tname']}</strong></br>&nbsp;&nbsp;
		{loop $pres['perm'] $perm}
		<input type="checkbox" {if (isset($group_role_list[$roleid]) && in_array($perm['p_code'],$group_role_list[$roleid]))}checked{/if} name="perm[{$roleid}][{$perm['p_code']}]" value="{$perm['p_code']}">{$perm['p_name']}&nbsp;
		{/loop}<br/>
	{/loop}
	</div>
	</td>
</tr>
{/loop}
<input type="hidden" name="gid" value="{$gid}">
<tr><th></th><td><input type="submit" value=" 确定 " class="button_style">&nbsp;<input type="button" class="button_style" onclick="self.location='{urldecode($forward)}'" value=" 返回 "></td></tr>
</table>
</form>
{template 'admin','footer'}